package com.zzyl.nursing.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDateTime;

/**
 * 预约创建请求 DTO
 * 对应前端提交的预约数据结构
 */
@Data
public class ReservationCreateDTO {

    @NotBlank(message = "预约人姓名不能为空")
    private String name;

    @NotNull(message = "预约时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private LocalDateTime time;

    @NotNull(message = "预约类型不能为空")
    private Integer type; // 0：参观预约，1：探访预约

    @NotBlank(message = "探访人姓名不能为空")
    private String visitor;

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String mobile;
}
